<?php
require 'dbcon.php';
   $id=$_REQUEST['id'];//添加ID
   $name=$_REQUEST['name'];//添加用户呢称
   $message=$_REQUEST['message'];//添加内容
   $date=$_REQUEST['time'];//添加时间
   $sql="insert into tb_note(id,name,message,time) values('{$id}','{$name}','{$message}','{$date}')";
   $rs=$db->query($sql);//执行SQL语句
    if  ($rs==true)
    {
       echo "<script language='javascript' type='text/javascript'>"; 
       //echo "alert('添加成功！');";
       echo "window.location.href='index.php';";
       echo "</script>";
    }
    else {
       echo "<script language='javascript' type='text/javascript'>"; 
       echo "alert('添加失败！');";
       echo "window.location.href='index.php';";
       echo "</script>";
   }